package com.moon.common.query;

import com.moon.common.type.AndOrType;
import com.moon.common.type.QueryTemplate;

public class Expression {

	private Object value;
	private String fieldName;
	private QueryTemplate template;
	private AndOrType andOrType;

	public Expression(Object value, String fieldName) {
		this.value = value;
		this.fieldName = fieldName;
		this.template = QueryTemplate.EQ;
		this.andOrType = AndOrType.AND;
	}

	public Expression(Object value, String fieldName, QueryTemplate template) {
		this.value = value;
		this.fieldName = fieldName;
		this.template = template;
		this.andOrType = AndOrType.AND;
	}

	public Expression(Object value, String fieldName, QueryTemplate template, AndOrType andOrType) {
		this.value = value;
		this.fieldName = fieldName;
		this.template = template;
		this.andOrType = andOrType;
	}

	public Object getValue() {
		return value;
	}

	public void setValue(Object value) {
		this.value = value;
	}

	public String getFieldName() {
		return fieldName;
	}

	public void setFieldName(String fieldName) {
		this.fieldName = fieldName;
	}

	public QueryTemplate getTemplate() {
		return template;
	}

	public void setTemplate(QueryTemplate template) {
		this.template = template;
	}

	public AndOrType getAndOrType() {
		return andOrType;
	}

	public void setAndOrType(AndOrType andOrType) {
		this.andOrType = andOrType;
	}

}
